Mapsend files are binary. This matters on dos-based OSes.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Wed, 14 Aug 2002 16:22:07 +0000 (16:22 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Wed, 14 Aug 2002 16:22:07 +0000 (16:22 +0000)
gpsbabel/mapsend.c

index ac4980553681f1ebf01abc00b3e321c2a4571190..3e6267b19335a03870beb6ba504e623e0b5c159b 100644 (file)
@@ -50,7 +50,7 @@ test_endianness(void)
 static void
 mapsend_rd_init(const char *fname)
 {
-       mapsend_file_in = fopen(fname, "r");
+       mapsend_file_in = fopen(fname, "rb");
        if (mapsend_file_in == NULL) {
                fprintf(stderr, "Cannot open '%s' for reading\n", fname);
                exit(1);
@@ -166,7 +166,7 @@ my_fwrite4(void *ptr, FILE *stream)
 static void
 mapsend_wr_init(const char *fname)
 {
-       mapsend_file_out = fopen(fname, "w");
+       mapsend_file_out = fopen(fname, "wb");
        if (mapsend_file_out == NULL) {
                fprintf(stderr, "Cannot open '%s' for writing\n", fname);
                exit(1);